package com.torry.workflow.service.wo.facade;

import com.torry.workflow.api.user.entity.User;
import com.torry.workflow.api.wo.api.ProcessUserGroupApi;
import com.torry.workflow.api.wo.entity.ProcessUserGroup;
import com.torry.workflow.service.wo.service.IProcessService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@DubboService
@Component
@Service
public class ProcessFacade implements ProcessUserGroupApi {

    @Resource
    private IProcessService iProcessService;

    @Override
    public List<ProcessUserGroup> getAllUserGroups() {
        return iProcessService.getAllUserGroups();
    }

    @Override
    public void insertUserGroup(ProcessUserGroup group) {
        iProcessService.insertUserGroup(group);
    }

    @Override
    public void updateUserGroup(ProcessUserGroup group) {
        iProcessService.updateUserGroup(group);
    }

    @Override
    public void deleteUserGroup(Integer groupId) {
        iProcessService.deleteUserGroup(groupId);
    }

    @Override
    public List<User> getUsersByUserGroupId(Integer userGroupId) {
        return iProcessService.getUsersByUserGroupId(userGroupId);
    }
}
